home *** CD-ROM | disk | FTP | other *** search
Wrap
RRRRWWWWbbbbiiiissssttttrrrreeeeaaaammmm((((3333CCCC++++++++)))) RRRRWWWWbbbbiiiissssttttrrrreeeeaaaammmm((((3333CCCC++++++++)))) NNNNaaaammmmeeee RWbistream - Rogue Wave library class SSSSyyyynnnnooooppppssssiiiissss #include <rw/bstream.h> RWbistream bstr(cin); // Construct an RWbistream, // using cin's streambuf DDDDeeeessssccccrrrriiiippppttttiiiioooonnnn Class RRRRWWWWbbbbiiiissssttttrrrreeeeaaaammmm specializes the abstract base class RRRRWWWWvvvviiiissssttttrrrreeeeaaaammmm to restore variables stored in binary format by RRRRWWWWbbbboooossssttttrrrreeeeaaaammmm. You can think of it as a binary veneer over an associated ssssttttrrrreeeeaaaammmmbbbbuuuuffff. Because the RRRRWWWWbbbbiiiissssttttrrrreeeeaaaammmm retains no information about the state of its associated ssssttttrrrreeeeaaaammmmbbbbuuuuffff, its use can be freely exchanged with other users of the ssssttttrrrreeeeaaaammmmbbbbuuuuffff (such as an iiiissssttttrrrreeeeaaaammmm or iiiiffffssssttttrrrreeeeaaaammmm). RRRRWWWWbbbbiiiissssttttrrrreeeeaaaammmm can be interrogated as to the stream state using member functions ggggoooooooodddd(((()))), bbbbaaaadddd(((()))), eeeeooooffff(((()))), eeeettttcccc. PPPPeeeerrrrssssiiiisssstttteeeennnncccceeee None EEEExxxxaaaammmmpppplllleeee See RRRRWWWWbbbboooossssttttrrrreeeeaaaammmm for an example of how the file "ddddaaaattttaaaa....ddddaaaatttt" might be created. #include <rw/bstream.h> #include <fstream.h> main(){ ifstream fstr("data.dat"); // Open an input file RWbistream bstr(fstr); // Construct RWbistream from it int i; float f; double d; bstr >> i; // Restore an int that was stored in binary bstr >> f >> d; // Restore a float & double } PPPPuuuubbbblllliiiicccc CCCCoooonnnnssssttttrrrruuuuccccttttoooorrrrssss RWbistream(streambuf* s); Construct an RRRRWWWWbbbbiiiissssttttrrrreeeeaaaammmm from the ssssttttrrrreeeeaaaammmmbbbbuuuuffff ssss. For DOS, this ssssttttrrrreeeeaaaammmmbbbbuuuuffff must have been opened in binary mode. PPPPaaaaggggeeee 1111 RRRRWWWWbbbbiiiissssttttrrrreeeeaaaammmm((((3333CCCC++++++++)))) RRRRWWWWbbbbiiiissssttttrrrreeeeaaaammmm((((3333CCCC++++++++)))) RWbistream(istream& str); Construct an RRRRWWWWbbbbiiiissssttttrrrreeeeaaaammmm using the ssssttttrrrreeeeaaaammmmbbbbuuuuffff associated with the iiiissssttttrrrreeeeaaaammmm ssssttttrrrr. For DOS, the ssssttttrrrreeeeaaaammmmbbbbuuuuffff must have been opened in binary mode. This can be done by specifying iiiioooossss::::::::bbbbiiiinnnnaaaarrrryyyy as part of the second argument to the constructor for and iiiiffffssssttttrrrreeeeaaaammmm. Using the example above, the line to create the iiiiffffssssttttrrrreeeeaaaammmm would read, iiiiffffssssttttrrrreeeeaaaammmm ffffssssttttrrrr((((""""ddddaaaattttaaaa....ddddaaaatttt"""",,,, iiiioooossss::::::::iiiinnnn |||| iiiioooossss::::::::bbbbiiiinnnnaaaarrrryyyy))));;;; where the "||||" is the binary OR operator. PPPPuuuubbbblllliiiicccc OOOOppppeeeerrrraaaattttoooorrrrssss virtual RWvistream& ooooppppeeeerrrraaaattttoooorrrr>>>>>>>>(char& c); Redefined from class RRRRWWWWvvvviiiissssttttrrrreeeeaaaammmm. Get the next cccchhhhaaaarrrr from the input stream and store it in cccc. virtual RWvistream& ooooppppeeeerrrraaaattttoooorrrr>>>>>>>>(wchar_t& wc); Redefined from class RRRRWWWWvvvviiiissssttttrrrreeeeaaaammmm. Get the next wide cccchhhhaaaarrrr from the input stream and store it in wwwwcccc. virtual RWvistream& ooooppppeeeerrrraaaattttoooorrrr>>>>>>>>(double& d); Redefined from class RRRRWWWWvvvviiiissssttttrrrreeeeaaaammmm. Get the next ddddoooouuuubbbblllleeee from the input stream and store it in dddd. virtual RWvistream& ooooppppeeeerrrraaaattttoooorrrr>>>>>>>>(float& f); Redefined from class RRRRWWWWvvvviiiissssttttrrrreeeeaaaammmm. Get the next ffffllllooooaaaatttt from the input stream and store it in ffff. virtual RWvistream& ooooppppeeeerrrraaaattttoooorrrr>>>>>>>>(int& i); Redefined from class RRRRWWWWvvvviiiissssttttrrrreeeeaaaammmm. Get the next iiiinnnntttt from the input stream and store it in iiii. virtual RWvistream& ooooppppeeeerrrraaaattttoooorrrr>>>>>>>>(long& l); Redefined from class RRRRWWWWvvvviiiissssttttrrrreeeeaaaammmm. Get the next lllloooonnnngggg from the input stream and store it in llll. PPPPaaaaggggeeee 2222 RRRRWWWWbbbbiiiissssttttrrrreeeeaaaammmm((((3333CCCC++++++++)))) RRRRWWWWbbbbiiiissssttttrrrreeeeaaaammmm((((3333CCCC++++++++)))) virtual RWvistream& ooooppppeeeerrrraaaattttoooorrrr>>>>>>>>(short& s); Redefined from class RRRRWWWWvvvviiiissssttttrrrreeeeaaaammmm. Get the next sssshhhhoooorrrrtttt from the input stream and store it in ssss. virtual RWvistream& ooooppppeeeerrrraaaattttoooorrrr>>>>>>>>(unsigned char& c); Redefined from class RRRRWWWWvvvviiiissssttttrrrreeeeaaaammmm. Get the next uuuunnnnssssiiiiggggnnnneeeedddd cccchhhhaaaarrrr from the input stream and store it in cccc. virtual RWvistream& ooooppppeeeerrrraaaattttoooorrrr>>>>>>>>(unsigned short& s); Redefined from class RRRRWWWWvvvviiiissssttttrrrreeeeaaaammmm. Get the next uuuunnnnssssiiiiggggnnnneeeedddd sssshhhhoooorrrrtttt from the input stream and store it in ssss. virtual RWvistream& ooooppppeeeerrrraaaattttoooorrrr>>>>>>>>(unsigned int& i); Redefined from class RRRRWWWWvvvviiiissssttttrrrreeeeaaaammmm. Get the next uuuunnnnssssiiiiggggnnnneeeedddd iiiinnnntttt from the input stream and store it in iiii. virtual RWvistream& ooooppppeeeerrrraaaattttoooorrrr>>>>>>>>(unsigned long& l); Redefined from class RRRRWWWWvvvviiiissssttttrrrreeeeaaaammmm. Get the next uuuunnnnssssiiiiggggnnnneeeedddd lllloooonnnngggg from the input stream and store it in llll. ooooppppeeeerrrraaaattttoooorrrr vvvvooooiiiidddd****(); Inherited via RRRRWWWWvvvviiiissssttttrrrreeeeaaaammmm from RRRRWWWWvvvviiiioooossss. PPPPuuuubbbblllliiiicccc MMMMeeeemmmmbbbbeeeerrrr FFFFuuuunnnnccccttttiiiioooonnnnssss virtual int ggggeeeetttt(); Redefined from class RRRRWWWWvvvviiiissssttttrrrreeeeaaaammmm. Get and return the next cccchhhhaaaarrrr from the input stream. Returns EEEEOOOOFFFF if end of file is encountered. virtual RWvistream& ggggeeeetttt(char& c); PPPPaaaaggggeeee 3333 RRRRWWWWbbbbiiiissssttttrrrreeeeaaaammmm((((3333CCCC++++++++)))) RRRRWWWWbbbbiiiissssttttrrrreeeeaaaammmm((((3333CCCC++++++++)))) Redefined from class RRRRWWWWvvvviiiissssttttrrrreeeeaaaammmm. Get the next cccchhhhaaaarrrr and store it in cccc. virtual RWvistream& ggggeeeetttt(wchar_t& wc); Redefined from class RRRRWWWWvvvviiiissssttttrrrreeeeaaaammmm. Get the next wide cccchhhhaaaarrrr and store it in wwwwcccc. virtual RWvistream& ggggeeeetttt(unsigned char& c); Redefined from class RRRRWWWWvvvviiiissssttttrrrreeeeaaaammmm. Get the next uuuunnnnssssiiiiggggnnnneeeedddd cccchhhhaaaarrrr and store it in cccc. virtual RWvistream& ggggeeeetttt(char* v, size_t N); Redefined from class RRRRWWWWvvvviiiissssttttrrrreeeeaaaammmm. Get a vector of cccchhhhaaaarrrrs and store them in the array beginning at vvvv. If the restore operation stops prematurely, because there are no more data available on the stream, because an exception is thrown, or for some other reason; ggggeeeetttt stores what has already been retrieved from the stream into vvvv, and sets the failbit. virtual RWvistream& ggggeeeetttt(wchar_t* v, size_t N); Redefined from class RRRRWWWWvvvviiiissssttttrrrreeeeaaaammmm. Get a vector of wide cccchhhhaaaarrrrs and store them in the array beginning at vvvv. If the restore operation stops prematurely, because there are no more data available on the stream, because an exception is thrown, or for some other reason; ggggeeeetttt stores what has already been retrieved from the stream into vvvv, and sets the failbit. virtual RWvistream& ggggeeeetttt(double* v, size_t N); Redefined from class RRRRWWWWvvvviiiissssttttrrrreeeeaaaammmm. Get a vector of ddddoooouuuubbbblllleeees and store them in the array beginning at vvvv. If the restore operation stops prematurely, because there are no more data available on the stream, because an exception is thrown, or for some other reason; ggggeeeetttt stores what has already been retrieved from the stream into vvvv, and sets the failbit. virtual RWvistream& ggggeeeetttt(float* v, size_t N); Redefined from class RRRRWWWWvvvviiiissssttttrrrreeeeaaaammmm. Get a vector of ffffllllooooaaaatttts and store them in the array beginning at vvvv. If the restore operation stops prematurely, PPPPaaaaggggeeee 4444 RRRRWWWWbbbbiiiissssttttrrrreeeeaaaammmm((((3333CCCC++++++++)))) RRRRWWWWbbbbiiiissssttttrrrreeeeaaaammmm((((3333CCCC++++++++)))) because there are no more data available on the stream, because an exception is thrown, or for some other reason; ggggeeeetttt stores what has already been retrieved from the stream into vvvv, and sets the failbit. virtual RWvistream& ggggeeeetttt(int* v, size_t N); Redefined from class RRRRWWWWvvvviiiissssttttrrrreeeeaaaammmm. Get a vector of iiiinnnntttts and store them in the array beginning at vvvv. If the restore operation stops prematurely, because there are no more data available on the stream, because an exception is thrown, or for some other reason; ggggeeeetttt stores what has already been retrieved from the stream into vvvv, and sets the failbit. virtual RWvistream& ggggeeeetttt(long* v, size_t N); Redefined from class RRRRWWWWvvvviiiissssttttrrrreeeeaaaammmm. Get a vector of lllloooonnnnggggs and store them in the array beginning at vvvv. If the restore operation stops prematurely, because there are no more data available on the stream, because an exception is thrown, or for some other reason; ggggeeeetttt stores what has already been retrieved from the stream into vvvv, and sets the failbit. virtual RWvistream& ggggeeeetttt(short* v, size_t N); Redefined from class RRRRWWWWvvvviiiissssttttrrrreeeeaaaammmm. Get a vector of sssshhhhoooorrrrtttts and store them in the array beginning at vvvv. If the restore operation stops prematurely, because there are no more data available on the stream, because an exception is thrown, or for some other reason; ggggeeeetttt stores what has already been retrieved from the stream into vvvv, and sets the failbit. virtual RWvistream& ggggeeeetttt(unsigned char* v, size_t N); Redefined from class RRRRWWWWvvvviiiissssttttrrrreeeeaaaammmm. Get a vector of uuuunnnnssssiiiiggggnnnneeeedddd cccchhhhaaaarrrrs and store them in the array beginning at vvvv. If the restore operation stops prematurely, because there are no more data available on the stream, because an exception is thrown, or for some other reason; ggggeeeetttt stores what has already been retrieved from the stream into vvvv, and sets the failbit. virtual RWvistream& ggggeeeetttt(unsigned short* v, size_t N); Redefined from class RRRRWWWWvvvviiiissssttttrrrreeeeaaaammmm. Get a vector of uuuunnnnssssiiiiggggnnnneeeedddd sssshhhhoooorrrrtttts and store them in the array beginning at vvvv. If the restore operation stops prematurely, because there are no more data available on the stream, because an exception is thrown, or for some other reason; ggggeeeetttt stores what PPPPaaaaggggeeee 5555 RRRRWWWWbbbbiiiissssttttrrrreeeeaaaammmm((((3333CCCC++++++++)))) RRRRWWWWbbbbiiiissssttttrrrreeeeaaaammmm((((3333CCCC++++++++)))) has already been retrieved from the stream into vvvv, and sets the failbit.. virtual RWvistream& ggggeeeetttt(unsigned int* v, size_t N); Redefined from class RRRRWWWWvvvviiiissssttttrrrreeeeaaaammmm. Get a vector of uuuunnnnssssiiiiggggnnnneeeedddd iiiinnnntttts and store them in the array beginning at vvvv. If the restore operation stops prematurely, because there are no more data available on the stream, because an exception is thrown, or for some other reason; ggggeeeetttt stores what has already been retrieved from the stream into vvvv, and sets the failbit. virtual RWvistream& ggggeeeetttt(unsigned long* v, size_t N); Redefined from class RRRRWWWWvvvviiiissssttttrrrreeeeaaaammmm. Get a vector of uuuunnnnssssiiiiggggnnnneeeedddd lllloooonnnnggggs and store them in the array beginning at vvvv. If the restore operation stops prematurely, because there are no more data available on the stream, because an exception is thrown, or for some other reason; ggggeeeetttt stores what has already been retrieved from the stream into vvvv, and sets the failbit. virtual RWvistream& ggggeeeettttSSSSttttrrrriiiinnnngggg(char* s, size_t N); Redefined from class RRRRWWWWvvvviiiissssttttrrrreeeeaaaammmm. Restores a character string from the input stream and stores it in the array beginning at ssss. The function stops reading at the end of the string or after NNNN----1111 characters, whichever comes first. If NNNN----1111 characters have been read and the NNNNtttthhhh character is not the string terminator, then the failbit of the stream will be set. In either case, the string will be terminated with a null byte. virtual RWvistream& ggggeeeettttSSSSttttrrrriiiinnnngggg(wchar_t* ws, size_t N); Redefined from class RRRRWWWWvvvviiiissssttttrrrreeeeaaaammmm. Restores a wide character string from the input stream and stores it in the array beginning at wwwwssss. The function stops reading at the end of the string or after NNNN----1111 characters, whichever comes first. If NNNN----1111 characters have been read and the NNNNtttthhhh character is not the string terminator, then the failbit of the stream will be set. In either case, the string will be terminated with a null byte. PPPPaaaaggggeeee 6666